package com.czh.springboot04.mapper;

import com.czh.springboot04.entity.CourseBuy;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CourseBuyMapper {

    int insertCourseBuy(CourseBuy courseBuy);
    int updateCourseBuyById(CourseBuy courseBuy);
    CourseBuy selectCourseBuyById(Integer buyId);
    List<CourseBuy> selectCourseBuyAll(@Param("courseId") Integer courseId,
                                       @Param("memberId") Integer memberId,
                                       @Param("minbuyPrice") double minbuyPrice,
                                       @Param("maxbuyPrice") double maxbuyPrice,
                                       @Param("buyState") Integer buyState);
    int deleteCourseBuyById(Integer buyId);
    int deleteCourseBuyByList(List<Integer> buyIdList);
//    查看所有购买记录
    List<CourseBuy> selectCourseBuyList();

    //根据用户id和课程id查询记录
    CourseBuy selectCourseBuyByMemberIdAndCourseId(@Param("courseId") int courseId,@Param("memberId") int memberId);
    List<CourseBuy> selectByMid(int memberId);
}
